
 <!DOCTYPE HTML>
<html >
<head>
  <meta charset="UTF-8">
  
    <title>苏佳鑫第七周周报 | B3434lockchain</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
    
    <meta name="author" content="b3434lockchain">
    

    
    <meta name="description" content="第一次周报   本周任务：完成一个桌面项目与后端之间通讯的MIni项目（一个登录注册系统）工作完成情况：前端雏形基本完成，与后台连接成功，数据传输格式待统一语言：JavaFX工具：Eclipse IDE、JavaFX Scene Builder2.0  [TOC] JavaFX 简介介绍JavaFX是Java的下一代图形用户界面工具包。JavaFX是一组图形和媒体API，我们可以用它们来创建和部">
<meta name="keywords" content="周报,苏佳鑫">
<meta property="og:type" content="article">
<meta property="og:title" content="苏佳鑫第七周周报">
<meta property="og:url" content="http://b3434lockchain.gitee.io/2019/04/15/jiaxin/jiaxin1/index.html">
<meta property="og:site_name" content="B3434lockchain">
<meta property="og:description" content="第一次周报   本周任务：完成一个桌面项目与后端之间通讯的MIni项目（一个登录注册系统）工作完成情况：前端雏形基本完成，与后台连接成功，数据传输格式待统一语言：JavaFX工具：Eclipse IDE、JavaFX Scene Builder2.0  [TOC] JavaFX 简介介绍JavaFX是Java的下一代图形用户界面工具包。JavaFX是一组图形和媒体API，我们可以用它们来创建和部">
<meta property="og:locale" content="default">
<meta property="og:updated_time" content="2019-04-19T02:12:01.351Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="苏佳鑫第七周周报">
<meta name="twitter:description" content="第一次周报   本周任务：完成一个桌面项目与后端之间通讯的MIni项目（一个登录注册系统）工作完成情况：前端雏形基本完成，与后台连接成功，数据传输格式待统一语言：JavaFX工具：Eclipse IDE、JavaFX Scene Builder2.0  [TOC] JavaFX 简介介绍JavaFX是Java的下一代图形用户界面工具包。JavaFX是一组图形和媒体API，我们可以用它们来创建和部">

    
    <link rel="alternative" href="/atom.xml" title="B3434lockchain" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/img/jacman.jpg">
    <link rel="apple-touch-icon-precomposed" href="/img/jacman.jpg">
    
    <link rel="stylesheet" href="/css/style.css">
</head>

  <body>
    <header>
      
<div>
		
			<div id="imglogo">
				<a href="/"><img src="/img/logo.png" alt="B3434lockchain" title="B3434lockchain"/></a>
			</div>
			
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="B3434lockchain">B3434lockchain</a></h1>
				<h2 class="blog-motto"></h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="Menu">
			</a></div>
			<nav class="animated">
				<ul>
					<ul>
					 
						<li><a href="/">Home</a></li>
					
						<li><a href="/archives">Archives</a></li>
					
						<li><a href="/about">About</a></li>
					
					<li>
 					
						<form class="search" action="https://www.baidu.com" target="_blank">
							<label>Search</label>
						<input name="s" type="hidden" value=  ><input type="text" name="q" size="30" placeholder="Search"><br>
						</form>
					
					</li>
				</ul>
			</nav>			
</div>
    </header>
    <div id="container">
      <div id="main" class="post" itemscope itemprop="blogPost">
  
	<article itemprop="articleBody"> 
		<header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2019/04/15/jiaxin/jiaxin1/" title="苏佳鑫第七周周报" itemprop="url">苏佳鑫第七周周报</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="b3434lockchain" target="_blank" itemprop="author">b3434lockchain</a>
		
  <p class="article-time">
    <time datetime="2019-04-15T03:00:00.000Z" itemprop="datePublished"> Published 2019-04-15</time>
    
  </p>
</header>
	<div class="article-content">
		
		<div id="toc" class="toc-article">
			<strong class="toc-title">Contents</strong>
		
			<ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#JavaFX-简介"><span class="toc-number">1.</span> <span class="toc-text">JavaFX 简介</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Scene-Builder简介"><span class="toc-number">2.</span> <span class="toc-text">Scene Builder简介</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#前端代码"><span class="toc-number">3.</span> <span class="toc-text">前端代码</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Httpclient调用后台接口"><span class="toc-number">4.</span> <span class="toc-text">Httpclient调用后台接口</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#总结"><span class="toc-number">5.</span> <span class="toc-text">总结</span></a></li></ol>
		
		</div>
		
		<blockquote>
<p><strong>第一次周报</strong></p>
</blockquote>
<blockquote>
<p><strong>本周任务</strong>：完成一个桌面项目与后端之间通讯的MIni项目（一个<strong>登录注册</strong>系统）<br><strong>工作完成情况</strong>：前端雏形基本完成，与后台连接成功，数据传输格式待统一<br><strong>语言</strong>：JavaFX<br><strong>工具</strong>：Eclipse IDE、JavaFX Scene Builder2.0</p>
</blockquote>
<p>[TOC]</p>
<h3 id="JavaFX-简介"><a href="#JavaFX-简介" class="headerlink" title="JavaFX 简介"></a><strong>JavaFX 简介</strong></h3><p><strong>介绍</strong><br>JavaFX是Java的下一代图形用户界面工具包。JavaFX是一组图形和媒体API，我们可以用它们来创建和部署富客户端应用程序。<br>JavaFX允许开发人员快速构建丰富的跨平台应用程序。JavaFX通过硬件加速图形支持现代GPU。<br>JavaFX允许开发人员在单个编程接口中组合图形，动画和UI控件。<br>图表编程语言可用于开发互联网应用程序(RIA）。JavaFX技术主要应用于创建Rich Internet applications（RIAs）。当前的JavaFX包括JavaFX脚本和JavaFX Mobile（一种运营于行动装置的操作系统），今后JavaFX将包括更多的产品。JavaFX Script编程语言（以下称为JavaFX）是一种声明性的、静态类型脚本语言。<br>JavaFX技术有着良好的前景，包括可以直接调用Java API的能力。因为 JavaFX Script是静态类型，它同样具有结构化代码、重用性和封装性，如包、类、继承和单独编译和发布单元，这些特性使得使用JavaFX技术创建和管理大型程序变为可能。<br><strong>可用性</strong><br>JavaFX API与Java SE运行时环境（JRE）和Java开发工具包（JDK）捆绑在一起。JDK可用于所有主要的桌面平台，Windows，Mac OS X和Linux。 JavaFX应用程序可以在所有主要的桌面平台上编译和运行。<br>JDK for ARM平台包括JavaFX的基础，图形和控件组件。<br><a href="https://www.yiibai.com/javafx/" target="_blank" rel="noopener">详细教程请参考：https://www.yiibai.com/javafx/</a></p>
<h3 id="Scene-Builder简介"><a href="#Scene-Builder简介" class="headerlink" title="Scene Builder简介"></a><strong>Scene Builder简介</strong></h3><p>JavaFX Scene Builder 是一个可视化布局工具，可快速设计 JavaFX 应用程序用户界面，无需编写代码。用户可以拖放UI 组件到工作区，修改组件的属性，应用样式表，而且在后台自动生成所创建布局的 FXML 代码。最后得到的是一个可以稍后与 Java 项目整合到一起的 FXML 文件，从而将 UI 与应用程序逻辑绑定起来。</p>
<h3 id="前端代码"><a href="#前端代码" class="headerlink" title="前端代码"></a><strong>前端代码</strong></h3><p>Main.java<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br></pre></td><td class="code"><pre><span class="line">package view;</span><br><span class="line">	</span><br><span class="line">import java.io.IOException;</span><br><span class="line">import java.net.URL;</span><br><span class="line"></span><br><span class="line">import controller.RootLayoutController;</span><br><span class="line">import javafx.application.Application;</span><br><span class="line">import javafx.fxml.FXMLLoader;</span><br><span class="line">import javafx.stage.Stage;</span><br><span class="line">import javafx.scene.Scene;</span><br><span class="line">import javafx.scene.control.Control;</span><br><span class="line">import javafx.scene.layout.*;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">public class Main extends Application &#123;</span><br><span class="line">	private Stage primaryStage;</span><br><span class="line">	</span><br><span class="line">	</span><br><span class="line">	</span><br><span class="line">	@Override</span><br><span class="line">	public void start(Stage primaryStage) &#123;</span><br><span class="line">		try &#123;</span><br><span class="line">			this.primaryStage=primaryStage;</span><br><span class="line">			</span><br><span class="line">			this.initRootLayout();</span><br><span class="line">		&#125; catch(Exception e) &#123;</span><br><span class="line">			e.printStackTrace();</span><br><span class="line">		&#125;</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	public static void main(String[] args) &#123;</span><br><span class="line">		launch(args);</span><br><span class="line">	&#125;</span><br><span class="line">	</span><br><span class="line">	public void initRootLayout() &#123;</span><br><span class="line">		try &#123;</span><br><span class="line">			FXMLLoader loader=new FXMLLoader();</span><br><span class="line">			loader.setLocation(getClass().getResource(&quot;RootLayout.fxml&quot;));</span><br><span class="line">			</span><br><span class="line">			</span><br><span class="line">			</span><br><span class="line">			AnchorPane rootlayout=(AnchorPane)loader.load();</span><br><span class="line">			</span><br><span class="line">			RootLayoutController controller=loader.getController();</span><br><span class="line">			</span><br><span class="line">			controller.Initialize();</span><br><span class="line">			</span><br><span class="line">			Scene scene=new Scene(rootlayout, 640,480);</span><br><span class="line">		</span><br><span class="line">			this.primaryStage.setScene(scene);</span><br><span class="line">			this.primaryStage.setResizable(false);</span><br><span class="line">			this.primaryStage.show();</span><br><span class="line">		</span><br><span class="line">		&#125; catch (IOException e) &#123;</span><br><span class="line">			// TODO Auto-generated catch block</span><br><span class="line">			e.printStackTrace();</span><br><span class="line">		&#125;</span><br><span class="line">		</span><br><span class="line">		</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>Register.java</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">package view;</span><br><span class="line"></span><br><span class="line">import java.io.IOException;</span><br><span class="line"></span><br><span class="line">import javafx.application.Application;</span><br><span class="line">import javafx.fxml.FXMLLoader;</span><br><span class="line">import javafx.scene.Scene;</span><br><span class="line">import javafx.scene.layout.AnchorPane;</span><br><span class="line">import javafx.stage.Stage;</span><br><span class="line"></span><br><span class="line">public class Register&#123;</span><br><span class="line"></span><br><span class="line">private Stage primaryStage=new Stage();</span><br><span class="line"></span><br><span class="line">public Register() throws Exception</span><br><span class="line">&#123;</span><br><span class="line">   FXMLLoader loader=new FXMLLoader();</span><br><span class="line">   loader.setLocation(getClass().getResource(&quot;Registerfxml.fxml&quot;));</span><br><span class="line">   AnchorPane rootlayout=(AnchorPane)loader.load();</span><br><span class="line">   </span><br><span class="line">   Scene scene=new Scene(rootlayout, 480,360);</span><br><span class="line">   </span><br><span class="line">   this.primaryStage.setScene(scene);</span><br><span class="line">   this.primaryStage.setResizable(false);</span><br><span class="line">   this.primaryStage.show();</span><br><span class="line">&#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>RootLayout.fxml (通过Scene Builder编辑)  </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br></pre></td><td class="code"><pre><span class="line">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span><br><span class="line"></span><br><span class="line">&lt;?import javafx.scene.text.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.paint.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.shape.*?&gt;</span><br><span class="line">&lt;?import javafx.geometry.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.image.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.control.*?&gt;</span><br><span class="line">&lt;?import java.lang.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.layout.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.layout.AnchorPane?&gt;</span><br><span class="line"></span><br><span class="line">&lt;AnchorPane fx:id=&quot;background&quot; maxHeight=&quot;-Infinity&quot; maxWidth=&quot;-Infinity&quot; minHeight=&quot;-Infinity&quot; minWidth=&quot;-Infinity&quot; prefHeight=&quot;480.0&quot; prefWidth=&quot;640.0&quot; styleClass=&quot;background&quot; stylesheets=&quot;@application.css&quot; xmlns=&quot;http://javafx.com/javafx/8&quot; xmlns:fx=&quot;http://javafx.com/fxml/1&quot; fx:controller=&quot;controller.RootLayoutController&quot;&gt;</span><br><span class="line">   &lt;children&gt;</span><br><span class="line">      &lt;BorderPane prefHeight=&quot;480.0&quot; prefWidth=&quot;640.0&quot; AnchorPane.bottomAnchor=&quot;0.0&quot; AnchorPane.leftAnchor=&quot;0.0&quot; AnchorPane.rightAnchor=&quot;0.0&quot; AnchorPane.topAnchor=&quot;0.0&quot;&gt;</span><br><span class="line">         &lt;center&gt;</span><br><span class="line">            &lt;VBox alignment=&quot;CENTER&quot; spacing=&quot;40.0&quot; BorderPane.alignment=&quot;CENTER&quot;&gt;</span><br><span class="line">               &lt;children&gt;</span><br><span class="line">                  &lt;HBox alignment=&quot;CENTER&quot; prefHeight=&quot;100.0&quot; prefWidth=&quot;200.0&quot;&gt;</span><br><span class="line">                     &lt;children&gt;</span><br><span class="line">                        &lt;ImageView fitHeight=&quot;30.0&quot; fitWidth=&quot;30.0&quot; pickOnBounds=&quot;true&quot; preserveRatio=&quot;true&quot; styleClass=&quot;usericon&quot;&gt;</span><br><span class="line">                           &lt;viewport&gt;</span><br><span class="line">                              &lt;Rectangle2D /&gt;</span><br><span class="line">                           &lt;/viewport&gt;</span><br><span class="line">                        &lt;/ImageView&gt;</span><br><span class="line">                        &lt;TextField fx:id=&quot;usertext&quot; prefHeight=&quot;30.0&quot; promptText=&quot;用户名&quot; /&gt;</span><br><span class="line">                     &lt;/children&gt;</span><br><span class="line">                  &lt;/HBox&gt;</span><br><span class="line">                  &lt;VBox alignment=&quot;CENTER&quot; spacing=&quot;10.0&quot;&gt;</span><br><span class="line">                     &lt;children&gt;</span><br><span class="line">                        &lt;HBox alignment=&quot;CENTER&quot;&gt;</span><br><span class="line">                           &lt;children&gt;</span><br><span class="line">                              &lt;ImageView fitHeight=&quot;30.0&quot; fitWidth=&quot;30.0&quot; pickOnBounds=&quot;true&quot; preserveRatio=&quot;true&quot; styleClass=&quot;pwicon&quot; /&gt;</span><br><span class="line">                              &lt;PasswordField fx:id=&quot;passfield&quot; maxHeight=&quot;30.0&quot; minHeight=&quot;30.0&quot; prefHeight=&quot;30.0&quot; promptText=&quot;密码&quot; /&gt;</span><br><span class="line">                           &lt;/children&gt;</span><br><span class="line">                        &lt;/HBox&gt;</span><br><span class="line">                        &lt;Label fx:id=&quot;forgot&quot; text=&quot;忘记密码？&quot; /&gt;</span><br><span class="line">                     &lt;/children&gt;</span><br><span class="line">                  &lt;/VBox&gt;</span><br><span class="line">                  &lt;VBox alignment=&quot;CENTER&quot; spacing=&quot;10.0&quot;&gt;</span><br><span class="line">                     &lt;children&gt;</span><br><span class="line">                        &lt;Text fx:id=&quot;mes&quot; strokeType=&quot;OUTSIDE&quot; strokeWidth=&quot;0.0&quot; /&gt;</span><br><span class="line">                        &lt;HBox alignment=&quot;CENTER&quot; prefHeight=&quot;100.0&quot; prefWidth=&quot;200.0&quot; spacing=&quot;20.0&quot;&gt;</span><br><span class="line">                           &lt;children&gt;</span><br><span class="line">                              &lt;Button fx:id=&quot;login&quot; mnemonicParsing=&quot;false&quot; onAction=&quot;#LoginHandler&quot; onMouseClicked=&quot;#LoginHandler&quot; stylesheets=&quot;@application.css&quot; text=&quot;登陆&quot; /&gt;</span><br><span class="line">                              &lt;Button fx:id=&quot;register&quot; mnemonicParsing=&quot;false&quot; onMouseClicked=&quot;#RegisterHandler&quot; text=&quot;注册&quot; textFill=&quot;#9a7272&quot; /&gt;</span><br><span class="line">                           &lt;/children&gt;</span><br><span class="line">                        &lt;/HBox&gt;</span><br><span class="line">                     &lt;/children&gt;</span><br><span class="line">                  &lt;/VBox&gt;</span><br><span class="line">               &lt;/children&gt;</span><br><span class="line">            &lt;/VBox&gt;</span><br><span class="line">         &lt;/center&gt;</span><br><span class="line">      &lt;/BorderPane&gt;</span><br><span class="line">   &lt;/children&gt;</span><br><span class="line">&lt;/AnchorPane&gt;</span><br></pre></td></tr></table></figure>
<p>Registerfxml.fxml  （通过Scene Builder编辑）<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br></pre></td><td class="code"><pre><span class="line">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span><br><span class="line"></span><br><span class="line">&lt;?import javafx.scene.effect.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.paint.*?&gt;</span><br><span class="line">&lt;?import javafx.geometry.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.text.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.control.*?&gt;</span><br><span class="line">&lt;?import java.lang.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.layout.*?&gt;</span><br><span class="line">&lt;?import javafx.scene.layout.AnchorPane?&gt;</span><br><span class="line"></span><br><span class="line">&lt;AnchorPane maxHeight=&quot;-Infinity&quot; maxWidth=&quot;-Infinity&quot; minHeight=&quot;-Infinity&quot; minWidth=&quot;-Infinity&quot; prefHeight=&quot;360.0&quot; prefWidth=&quot;480.0&quot; styleClass=&quot;bgbackground&quot; stylesheets=&quot;@register.css&quot; xmlns=&quot;http://javafx.com/javafx/8&quot; xmlns:fx=&quot;http://javafx.com/fxml/1&quot; fx:controller=&quot;controller.RegisterController&quot;&gt;</span><br><span class="line">   &lt;children&gt;</span><br><span class="line">      &lt;BorderPane prefHeight=&quot;360.0&quot; prefWidth=&quot;480.0&quot; AnchorPane.bottomAnchor=&quot;0.0&quot; AnchorPane.leftAnchor=&quot;0.0&quot; AnchorPane.rightAnchor=&quot;0.0&quot; AnchorPane.topAnchor=&quot;0.0&quot;&gt;</span><br><span class="line">         &lt;center&gt;</span><br><span class="line">            &lt;GridPane BorderPane.alignment=&quot;CENTER&quot;&gt;</span><br><span class="line">              &lt;columnConstraints&gt;</span><br><span class="line">                &lt;ColumnConstraints hgrow=&quot;SOMETIMES&quot; maxWidth=&quot;235.0&quot; minWidth=&quot;10.0&quot; prefWidth=&quot;190.0&quot; /&gt;</span><br><span class="line">                &lt;ColumnConstraints hgrow=&quot;SOMETIMES&quot; maxWidth=&quot;290.0&quot; minWidth=&quot;10.0&quot; prefWidth=&quot;290.0&quot; /&gt;</span><br><span class="line">              &lt;/columnConstraints&gt;</span><br><span class="line">              &lt;rowConstraints&gt;</span><br><span class="line">                &lt;RowConstraints minHeight=&quot;10.0&quot; prefHeight=&quot;30.0&quot; vgrow=&quot;SOMETIMES&quot; /&gt;</span><br><span class="line">                &lt;RowConstraints minHeight=&quot;10.0&quot; prefHeight=&quot;30.0&quot; vgrow=&quot;SOMETIMES&quot; /&gt;</span><br><span class="line">                &lt;RowConstraints minHeight=&quot;10.0&quot; prefHeight=&quot;30.0&quot; vgrow=&quot;SOMETIMES&quot; /&gt;</span><br><span class="line">              &lt;/rowConstraints&gt;</span><br><span class="line">               &lt;children&gt;</span><br><span class="line">                  &lt;Label lineSpacing=&quot;2.0&quot; stylesheets=&quot;@register.css&quot; text=&quot;用户名&quot; textFill=&quot;#2c294a&quot; GridPane.halignment=&quot;CENTER&quot; GridPane.valignment=&quot;CENTER&quot;&gt;</span><br><span class="line">                     &lt;font&gt;</span><br><span class="line">                        &lt;Font size=&quot;20.0&quot; /&gt;</span><br><span class="line">                     &lt;/font&gt;&lt;/Label&gt;</span><br><span class="line">                  &lt;Label text=&quot;密码&quot; textFill=&quot;#2c2e46&quot; GridPane.halignment=&quot;CENTER&quot; GridPane.rowIndex=&quot;1&quot; GridPane.valignment=&quot;CENTER&quot;&gt;</span><br><span class="line">                     &lt;font&gt;</span><br><span class="line">                        &lt;Font size=&quot;20.0&quot; /&gt;</span><br><span class="line">                     &lt;/font&gt;&lt;/Label&gt;</span><br><span class="line">                  &lt;Label text=&quot;确认密码&quot; textFill=&quot;#2c2c5b&quot; GridPane.halignment=&quot;CENTER&quot; GridPane.rowIndex=&quot;2&quot; GridPane.valignment=&quot;CENTER&quot;&gt;</span><br><span class="line">                     &lt;font&gt;</span><br><span class="line">                        &lt;Font size=&quot;20.0&quot; /&gt;</span><br><span class="line">                     &lt;/font&gt;&lt;/Label&gt;</span><br><span class="line">                  &lt;TextField fx:id=&quot;username&quot; GridPane.columnIndex=&quot;1&quot;&gt;</span><br><span class="line">                     &lt;GridPane.margin&gt;</span><br><span class="line">                        &lt;Insets right=&quot;30.0&quot; /&gt;</span><br><span class="line">                     &lt;/GridPane.margin&gt;</span><br><span class="line">                  &lt;/TextField&gt;</span><br><span class="line">                  &lt;PasswordField fx:id=&quot;pw&quot; GridPane.columnIndex=&quot;1&quot; GridPane.rowIndex=&quot;1&quot;&gt;</span><br><span class="line">                     &lt;GridPane.margin&gt;</span><br><span class="line">                        &lt;Insets right=&quot;30.0&quot; /&gt;</span><br><span class="line">                     &lt;/GridPane.margin&gt;</span><br><span class="line">                  &lt;/PasswordField&gt;</span><br><span class="line">                  &lt;PasswordField fx:id=&quot;mspw&quot; GridPane.columnIndex=&quot;1&quot; GridPane.rowIndex=&quot;2&quot;&gt;</span><br><span class="line">                     &lt;GridPane.margin&gt;</span><br><span class="line">                        &lt;Insets right=&quot;30.0&quot; /&gt;</span><br><span class="line">                     &lt;/GridPane.margin&gt;</span><br><span class="line">                  &lt;/PasswordField&gt;</span><br><span class="line">               &lt;/children&gt;</span><br><span class="line">            &lt;/GridPane&gt;</span><br><span class="line">         &lt;/center&gt;</span><br><span class="line">         &lt;bottom&gt;</span><br><span class="line">            &lt;VBox alignment=&quot;CENTER&quot; prefHeight=&quot;80.0&quot; spacing=&quot;10.0&quot; BorderPane.alignment=&quot;CENTER&quot;&gt;</span><br><span class="line">               &lt;children&gt;</span><br><span class="line">                  &lt;Text fx:id=&quot;mes&quot; strokeType=&quot;OUTSIDE&quot; strokeWidth=&quot;0.0&quot; /&gt;</span><br><span class="line">                  &lt;Button fx:id=&quot;register&quot; mnemonicParsing=&quot;false&quot; onAction=&quot;#registerHandler&quot; styleClass=&quot;rebutton&quot; stylesheets=&quot;@register.css&quot; text=&quot;注册&quot;&gt;</span><br><span class="line">                     &lt;cursor&gt;</span><br><span class="line">                        &lt;Cursor fx:constant=&quot;HAND&quot; /&gt;</span><br><span class="line">                     &lt;/cursor&gt;</span><br><span class="line">                     &lt;effect&gt;</span><br><span class="line">                        &lt;DropShadow /&gt;</span><br><span class="line">                     &lt;/effect&gt;&lt;/Button&gt;</span><br><span class="line">               &lt;/children&gt;</span><br><span class="line">               &lt;BorderPane.margin&gt;</span><br><span class="line">                  &lt;Insets bottom=&quot;10.0&quot; /&gt;</span><br><span class="line">               &lt;/BorderPane.margin&gt;</span><br><span class="line">            &lt;/VBox&gt;</span><br><span class="line">         &lt;/bottom&gt;</span><br><span class="line">      &lt;/BorderPane&gt;</span><br><span class="line">   &lt;/children&gt;</span><br><span class="line">&lt;/AnchorPane&gt;</span><br></pre></td></tr></table></figure></p>
<p>RootLayoutController.java</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br></pre></td><td class="code"><pre><span class="line">package controller;</span><br><span class="line"></span><br><span class="line">import java.awt.Color;</span><br><span class="line"></span><br><span class="line">import javafx.fxml.FXML;</span><br><span class="line">import javafx.scene.Cursor;</span><br><span class="line">import javafx.scene.control.*;</span><br><span class="line">import javafx.scene.image.Image;</span><br><span class="line">import javafx.scene.image.ImageView;</span><br><span class="line">import javafx.scene.layout.AnchorPane;</span><br><span class="line">import javafx.scene.layout.Background;</span><br><span class="line">import javafx.scene.layout.BackgroundImage;</span><br><span class="line">import javafx.scene.paint.*;</span><br><span class="line">import javafx.scene.text.Text;</span><br><span class="line">import model.Localauth;</span><br><span class="line">import view.Register;</span><br><span class="line">import Tool.*;</span><br><span class="line"></span><br><span class="line">public class RootLayoutController &#123;</span><br><span class="line">@FXML</span><br><span class="line">private AnchorPane anchorpane;</span><br><span class="line">@FXML</span><br><span class="line">private Button login;</span><br><span class="line">@FXML</span><br><span class="line">private Button register;</span><br><span class="line">@FXML</span><br><span class="line">private Label forgot;</span><br><span class="line">@FXML</span><br><span class="line">private Text mes;</span><br><span class="line">@FXML</span><br><span class="line">private TextField usertext;</span><br><span class="line">@FXML</span><br><span class="line">private PasswordField passfield;</span><br><span class="line"></span><br><span class="line">public void Initialize() &#123;</span><br><span class="line">   this.LabelEvent();</span><br><span class="line">   this.LoginEvent();</span><br><span class="line">   this.RegisterEvent();</span><br><span class="line">   </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">public void LoginEvent() &#123;</span><br><span class="line">   login.setOnMouseEntered(e-&gt;&#123;</span><br><span class="line">      login.setCursor(Cursor.HAND);		</span><br><span class="line">   &#125;);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">public void RegisterEvent() &#123;</span><br><span class="line">   register.setOnMouseEntered(e-&gt;&#123;</span><br><span class="line">      register.setCursor(Cursor.HAND);		</span><br><span class="line">   &#125;);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">public void LabelEvent()</span><br><span class="line">&#123;</span><br><span class="line">   forgot.setOnMouseEntered(e-&gt;&#123;</span><br><span class="line">      forgot.setTextFill(javafx.scene.paint.Color.BLUE);</span><br><span class="line">      forgot.setCursor(Cursor.HAND);</span><br><span class="line"></span><br><span class="line">   &#125;);</span><br><span class="line">   </span><br><span class="line">   forgot.setOnMouseExited(e-&gt;&#123;</span><br><span class="line">      forgot.setTextFill(javafx.scene.paint.Color.BLACK);</span><br><span class="line">   &#125;);</span><br><span class="line">   </span><br><span class="line">   </span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">public void LoginHandler()</span><br><span class="line">&#123;</span><br><span class="line">   String username=this.usertext.getText();</span><br><span class="line">   String password=this.passfield.getText();</span><br><span class="line">   Localauth local=new Localauth();</span><br><span class="line">   local.setPassword(password);</span><br><span class="line">   local.setUsername(username);</span><br><span class="line">   String mes=Tool.ConnectToServer.LoginRequest(local);</span><br><span class="line">   </span><br><span class="line">   this.mes.setText(mes);</span><br><span class="line">   this.mes.setFill(javafx.scene.paint.Color.RED);</span><br><span class="line">   if(mes.equals(&quot;登录成功!&quot;))</span><br><span class="line">   &#123;</span><br><span class="line">      this.usertext.setText(&quot;&quot;);</span><br><span class="line">      this.passfield.setText(&quot;&quot;);</span><br><span class="line">   &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">public void RegisterHandler()</span><br><span class="line">&#123;</span><br><span class="line">   try &#123;</span><br><span class="line">      new Register();</span><br><span class="line">   &#125; catch (Exception e) &#123;</span><br><span class="line">      // TODO Auto-generated catch block</span><br><span class="line">      e.printStackTrace();</span><br><span class="line">   &#125;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">public void setText(String message)</span><br><span class="line">&#123;</span><br><span class="line">   this.mes.setText(message);</span><br><span class="line">   this.mes.setFill(javafx.scene.paint.Color.RED);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>RegisterController.java</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></td><td class="code"><pre><span class="line">package controller;</span><br><span class="line"></span><br><span class="line">import javafx.fxml.FXML;</span><br><span class="line">import javafx.scene.control.*;</span><br><span class="line">import javafx.scene.paint.Color;</span><br><span class="line">import javafx.scene.text.Text;</span><br><span class="line">import model.Localauth;</span><br><span class="line"></span><br><span class="line">public class RegisterController &#123;</span><br><span class="line">	@FXML</span><br><span class="line">	private TextField username;</span><br><span class="line">//    @FXML</span><br><span class="line">//    private TextField nickname;</span><br><span class="line">//    @FXML</span><br><span class="line">//	private TextField email;</span><br><span class="line">//    @FXML</span><br><span class="line">//    private TextField phoneNum;</span><br><span class="line">    @FXML</span><br><span class="line">    private PasswordField pw;</span><br><span class="line">    @FXML</span><br><span class="line">    private PasswordField mspw;    </span><br><span class="line">    @FXML</span><br><span class="line">    private Button register;</span><br><span class="line">    @FXML</span><br><span class="line">    private Text mes;</span><br><span class="line">   </span><br><span class="line">    public void registerHandler()</span><br><span class="line">    &#123;</span><br><span class="line">    	if(pw.getText().equals(mspw.getText()))</span><br><span class="line">    	&#123;</span><br><span class="line">    		String username=this.username.getText();</span><br><span class="line">    		String password=this.pw.getText();</span><br><span class="line">    		Localauth local=new Localauth();</span><br><span class="line">    		local.setPassword(password);</span><br><span class="line">    		local.setUsername(username);</span><br><span class="line">    		</span><br><span class="line">    		String mes=Tool.ConnectToServer.RegisterRequest(local);</span><br><span class="line">    		</span><br><span class="line">    		this.mes.setText(mes);</span><br><span class="line">    		this.mes.setFill(Color.RED);</span><br><span class="line">    		</span><br><span class="line">    		if(mes.equals(&quot;注册成功!&quot;))</span><br><span class="line">    		&#123;</span><br><span class="line">    			this.pw.setText(&quot;&quot;);</span><br><span class="line">    			this.mspw.setText(&quot;&quot;);</span><br><span class="line">    			this.username.setText(&quot;&quot;);</span><br><span class="line">    			</span><br><span class="line">    		&#125;</span><br><span class="line">    	&#125;</span><br><span class="line">    &#125; </span><br><span class="line">    </span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h3 id="Httpclient调用后台接口"><a href="#Httpclient调用后台接口" class="headerlink" title="Httpclient调用后台接口"></a><strong>Httpclient调用后台接口</strong></h3><p>以往编写CS桌面应用或通过Socket完成与服务器通讯，或通过内嵌html直接向服务器发起请求并得到响应，本次尝试通过httpclient建立与后台的连接，完成与后台的通讯。</p>
<p>代码：</p>
<pre><code>package Tool;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URI;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.protocol.HTTP;

public class HttpUtils {

    private static String uristr=&quot;http://125.216.247.162:8091/u&quot;;

    public static String LoginRequest(String mes)
    {
        try {
            CloseableHttpClient httpClient = HttpClientBuilder.create().build(); 

            URI uri=new URI(uristr+&quot;/Login&quot;);
            HttpPost httpPost=new HttpPost(uri);

            httpPost.addHeader(HTTP.CONTENT_TYPE, &quot;application/json&quot;); 




            StringEntity entity;
            entity=new StringEntity(mes);
            httpPost.setEntity(entity);

            HttpResponse response; 
            response = httpClient.execute(httpPost);

            HttpEntity entitys = response.getEntity(); 
            BufferedReader in = new BufferedReader(new InputStreamReader(entitys.getContent(), &quot;UTF-8&quot;)); 
            StringBuffer buffer = new StringBuffer(); 
            String line = null; 
            while ((line = in.readLine()) != null) { 
            buffer.append(line); 
            } 
            return buffer.toString();

        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return null;

    }

    public static String RegisterRequest(String mes)
    {
        try {
            CloseableHttpClient httpClient = HttpClientBuilder.create().build(); 

            URI uri=new URI(uristr+&quot;/regist&quot;);
            HttpPost httpPost=new HttpPost(uri);

            httpPost.addHeader(HTTP.CONTENT_TYPE, &quot;application/json&quot;); 

            StringEntity entity;
            entity=new StringEntity(mes);
            httpPost.setEntity(entity);

            HttpResponse response; 
            response = httpClient.execute(httpPost);

            HttpEntity entitys = response.getEntity(); 
            BufferedReader in = new BufferedReader(new InputStreamReader(entitys.getContent(), &quot;UTF-8&quot;)); 
            StringBuffer buffer = new StringBuffer(); 
            String line = null; 
            while ((line = in.readLine()) != null) { 
            buffer.append(line); 
            } 
            return buffer.toString();

        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return null;

    }
}
</code></pre><h3 id="总结"><a href="#总结" class="headerlink" title="总结"></a><strong>总结</strong></h3><p>时间仓促，该Mini系统还有诸多未完成与未完善的部分。<br>前端部分javafx并未使用内嵌html编写界面，全部采用javafx自带控件，用CSS进行渲染<br>调用接口部分因为是第一次使用Httpclient类进行连接，数据传输部分还有漏洞需要解决<br>承载用户信息的Model类较为简单，有待拓展。<br>本周会针对这些问题进行解决。并对该系统的功能进行完善和拓展。</p>
  
	</div>
		<footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/周报/">周报</a><a href="/tags/苏佳鑫/">苏佳鑫</a>
  </div>

</div>



	<div class="article-share" id="share">
	
	  <div data-url="http://b3434lockchain.gitee.io/2019/04/15/jiaxin/jiaxin1/" data-title="苏佳鑫第七周周报 | B3434lockchain" data-tsina="" class="share clearfix">
	  </div>
	
	</div>


</footer>

   	       
	</article>
	
<nav class="article-nav clearfix">
 
 <div class="prev" >
 <a href="/2019/04/15/tanjunxi/tanjunxi6/" title="谭俊熙_mini桌面应用后端">
  <strong>上一篇：</strong><br/>
  <span>
  谭俊熙_mini桌面应用后端</span>
</a>
</div>


<div class="next">
<a href="/2018/11/25/lujiahao/lujiahao5/"  title="编写链码程序并测试">
 <strong>下一篇：</strong><br/> 
 <span>编写链码程序并测试
</span>
</a>
</div>

</nav>

	



</div>  
      <div class="openaside"><a class="navbutton" href="#" title="Show Sidebar"></a></div>

  <div id="toc" class="toc-aside">
  <strong class="toc-title">Contents</strong>
 
 <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#JavaFX-简介"><span class="toc-number">1.</span> <span class="toc-text">JavaFX 简介</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Scene-Builder简介"><span class="toc-number">2.</span> <span class="toc-text">Scene Builder简介</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#前端代码"><span class="toc-number">3.</span> <span class="toc-text">前端代码</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Httpclient调用后台接口"><span class="toc-number">4.</span> <span class="toc-text">Httpclient调用后台接口</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#总结"><span class="toc-number">5.</span> <span class="toc-text">总结</span></a></li></ol>
 
  </div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="Hide Sidebar"></a></div>
<aside class="clearfix">

  

  
<div class="tagslist">
	<p class="asidetitle">Tags</p>
		<ul class="clearfix">
		
			
				<li><a href="/tags/周报/" title="周报">周报<sup>23</sup></a></li>
			
		
			
				<li><a href="/tags/谭俊熙/" title="谭俊熙">谭俊熙<sup>11</sup></a></li>
			
		
			
				<li><a href="/tags/苏思捷/" title="苏思捷">苏思捷<sup>5</sup></a></li>
			
		
			
				<li><a href="/tags/学习报告/" title="学习报告">学习报告<sup>5</sup></a></li>
			
		
			
				<li><a href="/tags/卢家豪/" title="卢家豪">卢家豪<sup>5</sup></a></li>
			
		
			
				<li><a href="/tags/报告/" title="报告">报告<sup>5</sup></a></li>
			
		
			
				<li><a href="/tags/苏佳鑫/" title="苏佳鑫">苏佳鑫<sup>4</sup></a></li>
			
		
			
				<li><a href="/tags/冯华文/" title="冯华文">冯华文<sup>4</sup></a></li>
			
		
			
				<li><a href="/tags/周报反馈/" title="周报反馈">周报反馈<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/吴朝捷/" title="吴朝捷">吴朝捷<sup>2</sup></a></li>
			
		
			
				<li><a href="/tags/黎宁/" title="黎宁">黎宁<sup>1</sup></a></li>
			
		
			
				<li><a href="/tags/笔记/" title="笔记">笔记<sup>1</sup></a></li>
			
		
		</ul>
</div>


</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	
	<div class="social-font" class="clearfix">
		
		
		
		
		
		
		
		
		
		
	</div>
			
		

		<p class="copyright">
		
		</p>
</div>
</footer>
    <script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>
<script src="/js/jquery.qrcode-0.12.0.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
  
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else{
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
      
      $('#toc.toc-aside').css('display', 'none');
        
    }
  });
});
</script>

<script type="text/javascript">
$(document).ready(function(){ 
  var ai = $('.article-content>iframe'),
      ae = $('.article-content>embed'),
      t  = $('#toc'),
      ta = $('#toc.toc-aside'),
      o  = $('.openaside'),
      c  = $('.closeaside');
  if(ai.length>0){
    ai.wrap('<div class="video-container" />');
  };
  if(ae.length>0){
   ae.wrap('<div class="video-container" />');
  };
  c.click(function(){
    ta.css('display', 'block').addClass('fadeIn');
  });
  o.click(function(){
    ta.css('display', 'none');
  });
  $(window).scroll(function(){
    ta.css("top",Math.max(140,320-$(this).scrollTop()));
  });
});
</script>


<script type="text/javascript">
$(document).ready(function(){ 
  var $this = $('.share'),
      url = $this.attr('data-url'),
      encodedUrl = encodeURIComponent(url),
      title = $this.attr('data-title'),
      tsina = $this.attr('data-tsina'),
      description = $this.attr('description');
  var html = [
  '<div class="hoverqrcode clearfix"></div>',
  '<a class="overlay" id="qrcode"></a>',
  '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
  '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
  '<a href="#qrcode" class="article-share-qrcode" title="微信"></a>',
  '<a href="http://widget.renren.com/dialog/share?resourceUrl=' + encodedUrl + '&srcUrl=' + encodedUrl + '&title=' + title +'" class="article-share-renren" target="_blank" title="人人"></a>',
  '<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="微博"></a>',
  '<span title="Share to"></span>'
  ].join('');
  $this.append(html);

  $('.hoverqrcode').hide();

  var myWidth = 0;
  function updatehoverqrcode(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
    var qrsize = myWidth > 1024 ? 200:100;
    var options = {render: 'image', size: qrsize, fill: '#2ca6cb', text: url, radius: 0.5, quiet: 1};
    var p = $('.article-share-qrcode').position();
    $('.hoverqrcode').empty().css('width', qrsize).css('height', qrsize)
                          .css('left', p.left-qrsize/2+20).css('top', p.top-qrsize-10)
                          .qrcode(options);
  };
  $(window).resize(function(){
    $('.hoverqrcode').hide();
  });
  $('.article-share-qrcode').click(function(){
    updatehoverqrcode();
    $('.hoverqrcode').toggle();
  });
  $('.article-share-qrcode').hover(function(){}, function(){
      $('.hoverqrcode').hide();
  });
});   
</script>











<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.article-content').each(function(i){
    $(this).find('img').each(function(){
      if ($(this).parent().hasClass('fancybox')) return;
      var alt = this.alt;
      if (alt) $(this).after('<span class="caption">' + alt + '</span>');
      $(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
    });
    $(this).find('.fancybox').each(function(){
      $(this).attr('rel', 'article' + i);
    });
  });
  if($.fancybox){
    $('.fancybox').fancybox();
  }
}); 
</script>



<!-- Analytics Begin -->





<!-- Analytics End -->

<!-- Totop Begin -->

	<div id="totop">
	<a title="Back to Top"><img src="/img/scrollup.png"/></a>
	</div>
	<script src="/js/totop.js"></script>

<!-- Totop End -->

<!-- MathJax Begin -->
<!-- mathjax config similar to math.stackexchange -->


<!-- MathJax End -->

<!-- Tiny_search Begin -->

<!-- Tiny_search End -->

  </body>
</html>
